package com.litong.utils.projectvariable;

import java.io.File;
import java.util.Map;

import com.alit.face.koala.projectvariable.PVK;
import com.alit.face.koala.projectvariable.ProjectVariable;

public class PVU {
  public static void add(String key, String commnet, String value, boolean isReadOnly, boolean isSave) {
    ProjectVariableUtil.add(key, commnet, value, isReadOnly, isSave);
  }

  public static void setValue(ProjectVariable variable, boolean isSave) {
    ProjectVariableUtil.setValue(variable, isSave);
  }

  public static String getValue(String key) {
    return ProjectVariableUtil.getValue(key);
  }

  public static int size() {
    return ProjectVariableUtil.size();
  }

  public static Map<String, ProjectVariable> getParameters() {
    return ProjectVariableUtil.getParameters();
  }

  public static boolean getBooleanValue(String key) {
    return getValue(key).equals("true") ? true : false;
  }

  public static double getDouble(String key) {
    double value = Double.parseDouble(getValue(key));
    return value;
  }

  public static boolean isDev() {
    return ProjectVariableUtil.isDev();
  }

  public static String getJsonFilePath(String fileName) {
    String staticPath = PVU.getValue((PVK.projectStaticPath));
    return staticPath + File.separator + "json" + File.separator + fileName;
  }

}
